package com.aspose.cells;

abstract class zex {
   private static final com.aspose.cells.b.c.a.za a = new com.aspose.cells.b.c.a.za(new String[]{"COL", "ROW", "ADDRESS", "FILENAME", "WIDTH", "FORMAT", "PREFIX", "PROTECT", "CONTENTS", "TYPE", "COLOR", "PARENTHESES"});

   public static zagu a(zzi var0, zagu[] var1, zaay var2, int var3, int var4) {
      double[] var5 = new double[Math.min(var1.length, var3)];
      zyz var6 = zaaq.a(var1, var2, 0, (double[])var5, var4);
      if (var6 != null) {
         return var6;
      } else {
         double var9;
         String var16;
         double var18;
         int var21;
         switch(var0.l().b()) {
         case 13:
         case 204:
            var21 = 2;
            if (var5.length > 1) {
               var21 = (int)var5[1];
               if (var21 > 127) {
                  return zzg.a;
               }
            }

            return new zaam(a(var5[0], var21, var2));
         case 14:
            var21 = 2;
            if (var5.length > 1) {
               var21 = (int)var5[1];
            }

            boolean var17 = false;
            if (var1.length > 2) {
               boolean[] var26 = new boolean[1];
               var6 = zaaq.a(var1, var2, 2, (boolean[])var26);
               if (var6 != null) {
                  return var6;
               }

               var17 = var26[0];
            }

            if (var21 > 127) {
               return zzg.a;
            } else {
               if (var21 < -323) {
                  return new zaam("0");
               }

               return new zaam(a(var5[0], var21, var17, var2));
            }
         case 56:
         case 57:
         case 58:
         case 59:
         case 60:
            var18 = 0.0D;
            var9 = 0.0D;
            if (var5.length > 3) {
               var18 = var5[3];
               if (var5.length > 4 && var5[4] != 0.0D) {
                  var9 = 1.0D;
               }
            }

            switch(var0.l().b()) {
            case 56:
               return new zyy(zew.b(var5[0], var5[1], var5[2], var18, var9));
            case 57:
               return new zyy(zew.c(var5[0], var5[1], var5[2], var18, var9));
            case 58:
               return new zyy(zew.f(var5[0], var5[1], var5[2], var18, var9));
            case 59:
               return new zyy(zew.a(var5[0], var5[1], var5[2], var18, var9));
            case 60:
               double var22 = 0.1D;
               if (var5.length > 5) {
                  var22 = var5[5];
                  if (var22 == 0.0D) {
                     var22 = 0.1D;
                  }
               }

               return zew.c(var5[0], var5[1], var5[2], var18, var9, var22);
            default:
               return null;
            }
         case 109:
            if (var5[0] <= 0.0D) {
               return zze.a;
            } else {
               if (var5.length > 1) {
                  var18 = var5[1];
                  if (var18 <= 0.0D) {
                     return zze.a;
                  }

                  if (var18 == 1.0D) {
                     return zza.a;
                  }
               } else {
                  var18 = 10.0D;
               }

               return new zyy(com.aspose.cells.b.a.zq.a(var5[0], var18));
            }
         case 144:
         case 222:
         case 247:
            if (var5[2] == 0.0D) {
               return zza.a;
            } else if (var0.l().b() != 247) {
               if (var0.l().b() == 144) {
                  return (zagu)(var5[3] >= var5[2] + 1.0D ? zze.a : new zyy(zew.e(var5[0], var5[1], var5[2], var5[3], var5.length > 4 ? var5[4] : 2.0D)));
               } else if (var5[4] > var5[2] + 1.0D) {
                  return zze.a;
               } else {
                  var18 = 2.0D;
                  boolean var25 = false;
                  if (var5.length > 5) {
                     var18 = var5[5];
                     if (var5.length > 6) {
                        boolean[] var20 = new boolean[1];
                        var6 = zaaq.a(var1, var2, 6, (boolean[])var20);
                        if (var6 != null) {
                           return var6;
                        }

                        var25 = var20[0];
                     }
                  }

                  return new zyy(zew.a(var5[0], var5[1], var5[2], var5[3], var5[4], var18, var25));
               }
            } else if (var5[3] <= var5[2] + 1.0D && (var5[3] <= var5[2] || var5.length >= 5 && var5[4] != 12.0D)) {
               return var5[0] == 0.0D ? zyy.a : new zyy(zew.d(var5[0], var5[1], var5[2], var5[3], var5.length > 4 ? var5[4] : 12.0D));
            } else {
               return zze.a;
            }
         case 167:
         case 168:
            if (var5[0] >= 0.0D && var5[1] >= 1.0D && var5[2] >= var5[1]) {
               var18 = 0.0D;
               var9 = 0.0D;
               if (var5.length > 4) {
                  var18 = var5[4];
                  if (var5.length > 5 && var5[5] != 0.0D) {
                     var9 = 1.0D;
                  }
               }

               if (var0.l().b() == 168) {
                  return zaaq.a(zew.a(var5[0], var5[1], var5[2], var5[3], var18, var9));
               }

               return zaaq.a(zew.b(var5[0], var5[1], var5[2], var5[3], var18, var9));
            }

            return zze.a;
         case 197:
            return new zyy(com.aspose.cells.a.c.zm.a(var5[0], var5.length > 1 ? (int)var5[1] : 0, false));
         case 219:
            if (var5[0] >= 1.0D && var5[1] >= 1.0D) {
               var21 = (int)var5[0] - 1;
               int var8 = (int)var5[1] - 1;
               if (var21 <= var2.p.g() && var8 <= var2.p.h()) {
                  int var19 = 1;
                  boolean var10 = true;
                  String var11 = null;
                  if (var1.length > 2) {
                     if (var5[2] >= 1.0D && var5[2] < 9.0D) {
                        var19 = (int)var5[2];
                     } else if (var1[2] != zzk.a) {
                        return zzg.a;
                     }

                     if (var1.length > 3) {
                        if (var1[3] != zzk.a) {
                           boolean[] var12 = new boolean[1];
                           var6 = zaaq.a(var1, var2, 3, (boolean[])var12);
                           if (var6 != null) {
                              return var6;
                           }

                           var10 = var12[0];
                        }

                        if (var1.length > 4 && var1[4] != zzk.a) {
                           String[] var23 = new String[1];
                           var6 = zaaq.a(var1, var2, 4, (String[])var23);
                           if (var6 != null) {
                              return var6;
                           }

                           var11 = var23[0];
                        }
                     }
                  }

                  zaye var24 = new zaye((zur)null, var21, var8, var21, var8);
                  switch(var19) {
                  case 1:
                  case 5:
                  default:
                     break;
                  case 2:
                  case 6:
                     var24.b(false);
                     break;
                  case 3:
                  case 7:
                     var24.a(false);
                     break;
                  case 4:
                  case 8:
                     var24.a(false);
                     var24.b(false);
                  }

                  zaal var13 = new zaal(var0.d(), var24);
                  zaay var14 = new zaay(var2);
                  var14.c = var10;
                  StringBuilder var15 = new StringBuilder();
                  if (var11 != null) {
                     if (zaan.a(var11, var14)) {
                        var15.append('\'');
                        var15.append(com.aspose.cells.b.a.zv.a(var11, "'", "''"));
                        var15.append('\'');
                     } else {
                        var15.append(var11);
                     }

                     var15.append('!');
                  }

                  var14.g = -1;
                  var14.h = -1;
                  var13.a(var15, var14);
                  return new zaam(com.aspose.cells.b.a.zr.a(var15));
               }

               return zzg.a;
            }

            return zzg.a;
         case 270:
         case 272:
         case 504:
            var18 = 0.0D;
            var9 = 1.0D;
            if (var5.length > 3) {
               var18 = var5[3];
               if (var5.length > 4) {
                  var9 = var5[4];
               }
            }

            if (var0.l().b() == 270) {
               return zfe.a(var5[0], var5[1], var5[2], var18, var9, true);
            }

            return zfe.a(var5[0], var5[1], var5[2], var18, var9);
         case 387:
            if (var5[0] < 512.0D && var5[0] > -513.0D) {
               if (var5.length < 2) {
                  var16 = com.aspose.cells.b.a.ze.a((long)((int)var5[0]), 2);
                  if (var16.length() > 10) {
                     var16 = var16.substring(var16.length() - 10, var16.length() - 10 + 10);
                  }

                  return new zaam(var16.toUpperCase());
               }

               if (var5[1] >= 1.0D && var5[1] < 11.0D) {
                  return a(com.aspose.cells.b.a.ze.a((long)((int)var5[0]), 2), (int)var5[1]);
               }

               return zze.a;
            }

            return zze.a;
         case 388:
            if (var5[0] < 5.49755813888E11D && var5[0] > -5.49755813889E11D) {
               if (var5.length < 2) {
                  var16 = com.aspose.cells.b.a.ze.a((long)var5[0], 16);
                  if (var16.length() > 10) {
                     var16 = var16.substring(var16.length() - 10, var16.length() - 10 + 10);
                  }

                  return new zaam(var16.toUpperCase());
               }

               if (var5[1] >= 1.0D && var5[1] < 11.0D) {
                  return a(com.aspose.cells.b.a.ze.a((long)var5[0], 16), (int)var5[1]);
               }

               return zze.a;
            }

            return zze.a;
         case 389:
            if (var5[0] < 5.36870912E8D && var5[0] > -5.36870913E8D) {
               if (var5.length < 2) {
                  var16 = com.aspose.cells.b.a.ze.a((long)((int)var5[0]), 8);
                  if (var16.length() > 10) {
                     var16 = var16.substring(var16.length() - 10, var16.length() - 10 + 10);
                  }

                  return new zaam(var16.toUpperCase());
               }

               if (var5[1] >= 1.0D && var5[1] < 11.0D) {
                  return a(com.aspose.cells.b.a.ze.a((long)((int)var5[0]), 8), (int)var5[1]);
               }

               return zze.a;
            }

            return zze.a;
         case 411:
            if (var1.length > 2) {
               String[] var7 = new String[1];
               var6 = zaaq.a(var1, var2, 2, (String[])var7);
               if (var6 != null) {
                  return var6;
               }

               if (!"i".equals(var7[0]) && !"j".equals(var7[0])) {
                  return zzg.a;
               }

               return new zaam(com.aspose.cells.b.a.zr.a(new zmf(var5[0], var5[1], var7[0])));
            }

            return new zaam(com.aspose.cells.b.a.zr.a(new zmf(var5[0], var5[1], "i")));
         case 418:
            return new zyy(var5[0] == (var5.length > 1 ? var5[1] : 0.0D) ? 1.0D : 0.0D);
         case 419:
            return new zyy(var5[0] >= (var5.length > 1 ? var5[1] : 0.0D) ? 1.0D : 0.0D);
         case 423:
            if (var5[0] < 0.0D) {
               return zze.a;
            } else if (var5.length < 2) {
               return new zyy(zev.a(var5[0]));
            } else {
               if (var5[1] < 0.0D) {
                  return zze.a;
               }

               return new zyy(zev.a(var5[0]) - zev.a(var5[1]));
            }
         default:
            return null;
         }
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2, int var3) {
      String[] var4 = new String[Math.min(var1.length, var3)];
      zyz var5 = zaaq.a(var1, var2, 0, (String[])var4);
      if (var5 != null) {
         return var5;
      } else {
         switch(var0) {
         case 148:
            boolean var6 = true;
            if (var1.length > 1) {
               boolean[] var7 = new boolean[1];
               var5 = zaaq.a(var1, var2, 1, (boolean[])var7);
               if (var5 != null) {
                  return var5;
               }

               var6 = var7[0];
               if (!var6 && var4[0].indexOf(82) == -1 && var4[0].indexOf(67) == -1) {
                  return zzf.a;
               }
            }

            String var14 = a(var4[0], var2);
            if (var14 == null) {
               return zzf.a;
            } else {
               int var8;
               for(var8 = var14.length() - 1; var8 > -1 && var14.charAt(var8) == ' '; --var8) {
                  ;
               }

               if (var8 < 0) {
                  return zzf.a;
               } else {
                  var14 = var14.substring(0, 0 + var8 + 1);
                  if (!var14.equals(var14.trim())) {
                     return zzf.a;
                  } else {
                     Range var9 = var2.p.g.e(var14);
                     if (var9 != null) {
                        return ((ListObject)var9.b).getShowHeaderRow() ? new zaal(96, new zaye(var2.a(var9.getWorksheet().getIndex(), var9.getWorksheet().getIndex()), var9.getFirstRow() + 1, var9.getFirstColumn(), var9.getFirstRow() + var9.getRowCount() - 2, var9.getFirstColumn() + var9.getColumnCount() - 1)) : new zaal(96, new zaye(var2.a(var9.getWorksheet().getIndex(), var9.getWorksheet().getIndex()), var9.getFirstRow(), var9.getFirstColumn(), var9.getFirstRow() + var9.getRowCount() - 1, var9.getFirstColumn() + var9.getColumnCount() - 1));
                     } else if (var14.endsWith("]")) {
                        int[] var15 = zbsg.b(var2.p.g, var2.n, var2.g, var2.h, var14, false);
                        return new zaal(96, new zaye(var2.p.g.q().b(var15[0]), var15[1], var15[2], var15[3], var15[4]));
                     } else {
                        Name var10 = var2.p.g.getNames().get(var14);
                        if (var10 != null && var10.isVisible() && !var10.k()) {
                           return new zzj(32, var10, -1);
                        } else {
                           boolean var11 = var2.c;
                           var2.c = var6;
                           zagu var12 = var2.b("=" + var14);
                           var2.c = var11;
                           if (var12.b() == 9) {
                              zaal var13 = (zaal)var12;
                              if (var13.k().a() == null || (var13.k().a().b & '\uffff') != 65534) {
                                 return var12;
                              }
                           }

                           return zzf.a;
                        }
                     }
                  }
               }
            }
         case 359:
            if (var4.length > 1) {
               return new zaam(var4[1]);
            }

            return new zaam(var4[0]);
         default:
            return null;
         }
      }
   }

   private static String a(String var0, zaay var1) {
      if (var0.length() < 2) {
         return var0;
      } else {
         byte var2;
         if (var0.charAt(0) == '[') {
            var2 = 1;
         } else {
            if (var0.charAt(0) != '\'' || var0.charAt(1) != '[') {
               return var0;
            }

            var2 = 2;
         }

         int var3 = var0.indexOf(93);
         if (var3 > 0) {
            String var4 = var0.substring(var2, var2 + (var3 - var2));
            String var5 = var1.p.f.getFileName();
            if (var5.length() == var4.length()) {
               if (com.aspose.cells.a.c.zx.a(var5, var4)) {
                  if (var2 > 1) {
                     return "'" + var0.substring(var3 + 1);
                  }

                  return var0.substring(var3 + 1);
               }
            } else if (var5.length() > var4.length() && var5.replace('\\', '/').toUpperCase().endsWith(var4.toUpperCase())) {
               if (var2 > 1) {
                  return "'" + var0.substring(var3 + 1);
               }

               return var0.substring(var3 + 1);
            }
         }

         return null;
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2, int var3, int var4, int var5) {
      String[] var6 = new String[var3];
      zyz var7 = zaaq.a(var1, var2, 0, (String[])var6);
      if (var7 != null) {
         return var7;
      } else {
         double[] var8 = null;
         if (var1.length > var3) {
            var8 = new double[Math.min(var1.length - var3, var4)];
            var7 = zaaq.a(var1, var2, var3, var8, var5);
            if (var7 != null) {
               return var7;
            }
         }

         String var9;
         int var10;
         int var14;
         switch(var0) {
         case 82:
         case 206:
            if ("".equals(var6[1])) {
               return zzg.a;
            } else {
               var14 = 1;
               if (var8 != null) {
                  if (var8[0] < 1.0D) {
                     return zzg.a;
                  }

                  var14 = (int)var8[0];
               }

               if (var0 == 206) {
                  return zff.b(var6[0].toUpperCase(), var6[1].toUpperCase(), var14);
               }

               return zff.a(var6[0], var6[1], var14 - 1);
            }
         case 115:
         case 116:
         case 208:
         case 209:
            var14 = 1;
            if (var8 != null) {
               if (var8[0] < 0.0D) {
                  return zzg.a;
               }

               var14 = (int)var8[0];
               if (var14 == 0) {
                  return new zaam("");
               }
            }

            switch(var0) {
            case 208:
               return new zaam(zff.a((String)var6[0], 1, var14));
            case 209:
               return new zaam(zff.a(var6[0], var14));
            default:
               if (var14 >= var6[0].length()) {
                  return new zaam(var6[0]);
               } else {
                  if (var0 == 115) {
                     return new zaam(var6[0].substring(0, 0 + var14));
                  }

                  return new zaam(var6[0].substring(var6[0].length() - var14));
               }
            }
         case 120:
            if (var8 == null) {
               if ("".equals(var6[1])) {
                  return new zaam(var6[0]);
               }

               return new zaam(com.aspose.cells.b.a.zv.a(var6[0], var6[1], var6[2]));
            } else {
               var14 = (int)var8[0];
               if (var14 < 1 || var14 == 1 && var1[3].e(var2).b() == 1) {
                  return zzg.a;
               } else if ("".equals(var6[1])) {
                  return new zaam(var6[0]);
               } else {
                  var10 = -1;
                  String var11 = var6[0];
                  String var12 = var6[1];

                  for(int var13 = 0; var13 < var14; ++var13) {
                     var10 = var11.indexOf(var12, var10 + 1);
                     if (var10 < 0) {
                        return new zaam(var11);
                     }
                  }

                  return new zaam(var11.substring(0, 0 + var10) + var6[2] + var11.substring(var10 + var12.length()));
               }
            }
         case 124:
         case 205:
            var14 = 1;
            if (var8 != null) {
               if (var8[0] < 1.0D) {
                  return zzg.a;
               }

               var14 = (int)var8[0];
            }

            if (var0 == 205) {
               return zff.b(var6[0], var6[1], var14);
            } else {
               var10 = var6[1].indexOf(var6[0], var14 - 1);
               if (var10 < 0) {
                  return zzg.a;
               }

               return new zyy((double)var10 + 1.0D);
            }
         case 384:
            var9 = zev.c(var6[0]);
            if (var9 == null) {
               return zze.a;
            } else {
               switch(var9.length()) {
               case 1:
               case 2:
                  break;
               case 3:
                  if (var9.charAt(0) > '1') {
                     return zze.a;
                  }
                  break;
               case 4:
               case 5:
               case 6:
               case 7:
               case 8:
               case 9:
               default:
                  return zze.a;
               case 10:
                  if (!var9.startsWith("FFFFFFF") || var9.charAt(7) != 'F' && var9.charAt(7) != 'E') {
                     return zze.a;
                  }
               }

               return a(var6[0], 16, 2, var8);
            }
         case 386:
            var9 = zev.c(var6[0]);
            if (var9 == null) {
               return zze.a;
            } else {
               switch(var9.length()) {
               case 8:
                  if (var9.charAt(0) > '1') {
                     return zze.a;
                  }
                  break;
               case 9:
                  return zze.a;
               case 10:
                  if (!var9.startsWith("FF") || var9.charAt(2) != 'F' && var9.charAt(2) != 'E') {
                     return zze.a;
                  }
               }

               return a(var6[0], 16, 8, var8);
            }
         case 390:
            var9 = zev.b(var6[0]);
            if (var9 == null) {
               return zze.a;
            } else {
               if (var9.length() > 3) {
                  if (var9.length() != 10) {
                     return zze.a;
                  }

                  if (!var9.startsWith("7777777")) {
                     return zze.a;
                  }
               }

               return a(var6[0], 8, 2, var8);
            }
         case 391:
            var9 = zev.b(var6[0]);
            if (var9 == null) {
               return zze.a;
            }

            return a(var9, 8, 16, var8);
         case 394:
            var9 = zev.a(var6[0]);
            if (var9 == null) {
               return zze.a;
            }

            return a(var9, 2, 8, var8);
         case 395:
            var9 = zev.a(var6[0]);
            if (var9 == null) {
               return zze.a;
            }

            return a(var9, 2, 16, var8);
         default:
            return null;
         }
      }
   }

   public static zagu b(int var0, zagu[] var1, zaay var2, int var3, int var4, int var5) {
      DateTime[] var6 = new DateTime[var3];
      zyz var7 = zaaq.a(var1, var2, 0, (DateTime[])var6, var5);
      if (var7 != null) {
         return var7;
      } else {
         double[] var8 = null;
         if (var1.length > var3) {
            var8 = new double[Math.min(var1.length - var3, var4)];
            var7 = zaaq.a(var1, var2, var3, var8, var5);
            if (var7 != null) {
               return var7;
            }
         }

         int var12;
         switch(var0) {
         case 431:
            if (com.aspose.cells.a.c.zk.d(var6[2], var6[0]) && com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] >= 0.0D) {
               var12 = 0;
               if (var8.length > 2) {
                  if (var8[2] < 0.0D || var8[2] >= 5.0D) {
                     return zze.a;
                  }

                  var12 = (int)var8[2];
               }

               return new zyy(zew.a(var6[0], var6[1], var6[2], var8[0], var8[1], var12));
            } else {
               return zze.a;
            }
         case 432:
            if (com.aspose.cells.a.c.zk.d(var6[2], var6[0]) && com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] > 0.0D) {
               var12 = 0;
               if (var8.length > 2) {
                  if (var8[2] < 0.0D || var8[2] >= 5.0D) {
                     return zze.a;
                  }

                  var12 = (int)var8[2];
               }

               return new zyy(zew.b(var6[0], var6[1], var6[2], var8[0], var8[1], var12));
            }

            return zze.a;
         case 433:
         case 434:
         case 435:
         case 436:
         case 437:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] > 0.0D && var8[1] > 0.0D) {
               var12 = 0;
               if (var8.length > 2) {
                  if (var8[2] < 0.0D || var8[2] >= 5.0D) {
                     return zze.a;
                  }

                  var12 = (int)var8[2];
               }

               switch(var0) {
               case 433:
                  return new zyy(zew.c(var6[0], var6[1], var8[0], var8[1], var12));
               case 434:
                  return new zyy(zew.e(var6[0], var6[1], var8[0], var8[1], var12));
               case 435:
                  return new zyy(zew.b(var6[0], var6[1], var8[0], var8[1], var12));
               case 436:
                  return new zyy(zew.d(var6[0], var6[1], var8[0], var8[1], var12));
               case 437:
                  return new zyy(zew.f(var6[0], var6[1], var8[0], var8[1], var12));
               }
            }

            return zze.a;
         case 438:
         case 439:
         case 440:
         case 443:
         case 444:
         case 445:
         case 446:
         case 447:
         case 448:
         case 449:
         case 450:
         case 451:
         case 464:
         case 465:
         case 466:
         case 467:
         case 468:
         default:
            return null;
         case 441:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] >= 0.0D && var8[2] > 0.0D) {
               switch((int)var8[3]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 4) {
                     if (var8[4] < 0.0D || var8[4] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[4];
                  }

                  return new zyy(zew.a(var6[0], var6[1], var8[0], var8[1], (double)((int)var8[2]), (int)var8[3], var12));
               case 3:
               }
            }

            return zze.a;
         case 442:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] > 0.0D && var8[2] > 0.0D) {
               switch((int)var8[3]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 4) {
                     if (var8[4] < 0.0D || var8[4] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[4];
                  }

                  return zew.b(var6[0], var6[1], var8[0], var8[1], (double)((int)var8[2]), (int)var8[3], var12);
               case 3:
               }
            }

            return zze.a;
         case 452:
         case 453:
         case 454:
         case 455:
         case 456:
         case 457:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1])) {
               switch((int)var8[0]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 1) {
                     if (var8[1] < 0.0D || var8[1] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[1];
                  }

                  switch(var0) {
                  case 452:
                     return new zyy(zew.a(var6[0], var6[1], (int)var8[0], var12));
                  case 453:
                     return new zyy(zew.b(var6[0], var6[1], (int)var8[0], var12));
                  case 454:
                     return new zyy(zew.c(var6[0], var6[1], (int)var8[0], var12));
                  case 455:
                     return zaaq.a(zew.d(var6[0], var6[1], (int)var8[0], var12), var2);
                  case 456:
                     return new zyy(zew.f(var6[0], var6[1], (int)var8[0], var12));
                  case 457:
                     return zaaq.a(zew.e(var6[0], var6[1], (int)var8[0], var12), var2);
                  }
               case 3:
               }
            }

            return zze.a;
         case 458:
         case 459:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] >= 0.0D) {
               switch((int)var8[2]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 3) {
                     if (var8[3] < 0.0D || var8[3] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[3];
                  }

                  return new zyy(zew.a(var6[0], var6[1], var8[0], var8[1], (int)var8[2], var12, var0 == 459));
               case 3:
               }
            }

            return zze.a;
         case 460:
         case 461:
            if (com.aspose.cells.a.c.zk.d(var6[2], var6[0]) && com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] >= 0.0D && var8[1] >= 0.0D && var8[2] >= 0.0D) {
               switch((int)var8[3]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 4) {
                     if (var8[4] < 0.0D || var8[4] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[4];
                  }

                  return new zyy(zew.a(var6[0], var6[1], var6[2], var8[0], var8[1], var8[2], (int)var8[3], var12, var0 == 460));
               case 3:
               }
            }

            return zze.a;
         case 462:
            if (com.aspose.cells.a.c.zk.d(var6[2], var6[0]) && com.aspose.cells.a.c.zk.d(var6[0], var6[3]) && com.aspose.cells.a.c.zk.d(var6[3], var6[1]) && var8[0] >= 0.0D && var8[1] >= 0.0D && var8[2] >= 0.0D) {
               switch((int)var8[3]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 4) {
                     if (var8[4] < 0.0D || var8[4] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[4];
                  }

                  return new zyy(zew.a(var6[0], var6[1], var6[2], var6[3], var8[0], var8[1], var8[2], (int)var8[3], var12));
               case 3:
               }
            }

            return zze.a;
         case 463:
            if (com.aspose.cells.a.c.zk.d(var6[2], var6[0]) && com.aspose.cells.a.c.zk.d(var6[0], var6[3]) && com.aspose.cells.a.c.zk.d(var6[3], var6[1]) && var8[0] >= 0.0D && var8[1] > 0.0D && var8[2] > 0.0D) {
               switch((int)var8[3]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  if (var8.length > 4) {
                     if (var8[4] < 0.0D || var8[4] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[4];
                  }

                  return (new zaov(var6[0], var6[1], var6[2], var6[3], var8[0], var8[1], (int)var8[2], (int)var8[3], var12, 0.05D)).c(0.05D);
               case 3:
               }
            }

            return zze.a;
         case 469:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[2]) && var8[0] > 0.0D && var8[1] > 0.0D) {
               switch((int)var8[2]) {
               case 1:
               case 2:
               case 4:
                  var12 = 0;
                  boolean var10 = true;
                  if (var8.length > 3) {
                     if (var8[3] < 0.0D || var8[3] >= 5.0D) {
                        return zze.a;
                     }

                     var12 = (int)var8[3];
                     if (var1.length > 7) {
                        boolean[] var13 = new boolean[1];
                        var7 = zaaq.a(var1, var2, 2, (boolean[])var13);
                        if (var7 != null) {
                           return var7;
                        }

                        var10 = var13[0];
                     }
                  }

                  return zew.a(var6[0], var6[1], var6[2], var8[0], var8[1], (int)var8[2], var12);
               case 3:
               }
            }

            return zze.a;
         case 470:
            if (com.aspose.cells.a.c.zk.d(var6[0], var6[1]) && var8[0] > 0.0D) {
               double var9 = 1000.0D;
               int var11 = 0;
               if (var8.length > 1) {
                  if (var8[1] <= 0.0D) {
                     return zze.a;
                  }

                  var9 = var8[1];
                  if (var8.length > 2) {
                     if (var8[2] < 0.0D || var8[2] >= 5.0D) {
                        return zze.a;
                     }

                     var11 = (int)var8[2];
                  }
               }

               return new zyy(zew.a(var6[0], var6[1], var8[0], var9, var11));
            } else {
               return zze.a;
            }
         }
      }
   }

   public static zagu c(int var0, zagu[] var1, zaay var2, int var3, int var4, int var5) {
      double[] var6 = new double[var3];
      zyz var7 = zaaq.a(var1, var2, 0, (double[])var6, var5);
      if (var7 != null) {
         return var7;
      } else {
         boolean[] var8 = new boolean[var4];
         var7 = zaaq.a(var1, var2, var3, var8);
         if (var7 != null) {
            return var7;
         } else {
            switch(var0) {
            case 503:
               double var9 = 0.0D;
               double var11 = 1.0D;
               if (var1.length > 4) {
                  double[] var13 = new double[var1.length - 4];
                  var7 = zaaq.a(var1, var2, 4, (double[])var13, var5);
                  if (var7 != null) {
                     return var7;
                  }

                  var9 = var13[0];
                  if (var13.length > 1) {
                     var11 = var13[1];
                  }
               }

               return zfe.a(var6[0], var6[1], var6[2], var9, var11, var8[0]);
            default:
               return null;
            }
         }
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2, int var3, int var4, int var5, int var6) {
      double[] var7 = new double[var3];
      zyz var8 = zaaq.a(var1, var2, 0, (double[])var7, var6);
      if (var8 != null) {
         return var8;
      } else {
         DateTime[] var9 = new DateTime[var4];
         var8 = zaaq.a(var1, var2, var3, var9, var6);
         if (var8 != null) {
            return var8;
         } else {
            double[] var10 = null;
            if (var1.length > var3 + var4) {
               var10 = new double[Math.min(var1.length - var3 - var4, var5)];
               var8 = zaaq.a(var1, var2, var3 + var4, var10, var6);
               if (var8 != null) {
                  return var8;
               }
            }

            switch(var0) {
            case 466:
               return zew.a(var7[0], var9[0], var9[1], var10[0], var10[1], var10[2], var10.length > 3 ? (int)var10[3] : 0);
            case 467:
               return zew.b(var7[0], var9[0], var9[1], var10[0], var10[1], var10[2], var10.length > 3 ? (int)var10[3] : 0);
            default:
               return null;
            }
         }
      }
   }

   static zagu a(int var0, zagu[] var1, zaay var2) {
      boolean var3 = true;
      boolean var4 = true;
      zagu var5 = zaaq.a(var1[0], var2);
      if (var5.b() != 9) {
         return var5;
      } else {
         zaye var6 = ((zaal)var5).k();
         int var13 = var6.f() - var6.b() + 1;
         int var14 = var6.h() - var6.d() + 1;
         double[] var7 = new double[Math.min(var1.length - 1, 4)];
         zyz var8 = zaaq.a(var1, var2, 1, (double[])var7, 7);
         if (var8 != null) {
            return var8;
         } else {
            int var9 = var6.b() + (int)var7[0];
            if (var9 >= 0 && var9 <= var2.p.g()) {
               int var10 = var6.d() + (int)var7[1];
               if (var10 >= 0 && var10 <= var2.p.h()) {
                  if (var7.length > 2) {
                     if (var1[3] != zzk.a) {
                        if (var7[2] == 0.0D) {
                           return zzf.a;
                        }

                        var13 = a(var7[2]);
                     }

                     if (var7.length > 3 && var1[4] != zzk.a) {
                        if (var7[3] == 0.0D) {
                           return zzf.a;
                        }

                        var14 = a(var7[3]);
                     }
                  }

                  int var11;
                  if (var13 <= 0) {
                     var11 = var9;
                     var9 = var9 + var13 + 1;
                     if (var9 < 0 || var9 > var2.p.g()) {
                        return zzf.a;
                     }
                  } else {
                     var11 = var9 + var13 - 1;
                     if (var11 < 0 || var11 > var2.p.g()) {
                        return zzf.a;
                     }
                  }

                  int var12;
                  if (var14 <= 0) {
                     var12 = var10;
                     var10 = var10 + var14 + 1;
                     if (var10 < 0 || var10 > var2.p.h()) {
                        return zzf.a;
                     }
                  } else {
                     var12 = var10 + var14 - 1;
                     if (var12 < 0 || var12 > var2.p.h()) {
                        return zzf.a;
                     }
                  }

                  return new zaal(var0, new zaye(var6.a(), var9, var10, var11, var12));
               } else {
                  return zzf.a;
               }
            } else {
               return zzf.a;
            }
         }
      }
   }

   static zagu b(int var0, zagu[] var1, zaay var2) {
      zagu var3 = var1[0];

      label122:
      while(true) {
         switch(var3.b()) {
         case 0:
            return var3;
         case 7:
         case 8:
            if (var3.d() == 64 && var3.a(var2) == 64) {
               break label122;
            }

            var3 = var3.d(var2);
            break;
         case 12:
            return zzg.a;
         default:
            break label122;
         }
      }

      double[] var4 = new double[Math.min(var1.length - 1, 3)];
      zyz var5 = zaaq.a(var1, var2, 1, (double[])var4, 7);
      if (var5 != null) {
         return var5;
      } else {
         int var6 = (int)var4[0];
         if (var6 < 0) {
            return zzg.a;
         } else {
            int var7 = -1;
            int var8 = 1;
            if (var4.length > 1) {
               var7 = (int)var4[1];
               if (var7 < 0) {
                  return zzg.a;
               }

               if (var4.length > 2) {
                  var8 = (int)var4[2];
                  if (var8 < 1) {
                     return zzg.a;
                  }
               }
            }

            while(true) {
               while(true) {
                  label100:
                  switch(var3.b()) {
                  case 0:
                     return var3;
                  case 1:
                  case 2:
                  case 3:
                  case 4:
                  case 6:
                  case 10:
                  case 11:
                  default:
                     break;
                  case 5:
                     switch(var3.a()) {
                     case 15:
                     case 17:
                     case 18:
                     case 21:
                        var3 = var3.d(var2);
                        continue;
                     case 16:
                        zagu[] var11 = zaaq.a((zzw)var3);
                        if (var8 > var11.length) {
                           return zzf.a;
                        }

                        var3 = var11[var8 - 1];
                        continue;
                     case 19:
                     case 20:
                     default:
                        zahn var12 = var3.a(var2, false);
                        if (var12.l()) {
                           return zzg.a;
                        }

                        var12.b(true);
                        var3 = zayc.a(var12);
                        var12.a(true);
                        break label100;
                     }
                  case 7:
                  case 8:
                     if (var3.d() != 64 || var3.a(var2) != 64) {
                        var3 = var3.d(var2);
                        continue;
                     }
                     break;
                  case 9:
                     zaye var9 = ((zaal)var3).k();
                     if (var7 < 0 && var9.q() > 1 && var9.p() > 1) {
                        return zzf.a;
                     }
                     break;
                  case 12:
                     return zzg.a;
                  }

                  zagu var10;
                  int[] var13;
                  if (var6 == 0) {
                     if (var7 <= 0) {
                        return var3;
                     }

                     var13 = new int[]{var7 - 1};
                     var10 = var3.b(var13, var2);
                     if (var7 > var13[0]) {
                        return zzf.a;
                     }

                     return var10;
                  }

                  if (var7 <= 0) {
                     --var6;
                     var13 = new int[]{var6};
                     var10 = var3.a(var13, var2);
                     if (var7 < 0 && var13[0] == 1) {
                        var13[0] = var6;
                        var10 = var3.b(var13, var2);
                        if (var6 < var13[0]) {
                           return var10;
                        }
                     }

                     if (var6 < var13[0]) {
                        return var10;
                     }

                     return zzf.a;
                  }

                  var13 = new int[]{var6 - 1, var7 - 1};
                  var10 = var3.a(var13, var2, true);
                  if (var6 <= var13[0] && var7 <= var13[1]) {
                     return var10;
                  }

                  return zzf.a;
               }
            }
         }
      }
   }

   public static zagu a(zagu[] var0, zaay var1, boolean var2) {
      if (var0 != null && var0.length >= 1) {
         zagu var3 = zaaq.a(var0[0], var1);
         if (var3.b() == 0) {
            return var3;
         } else {
            zaye var4 = ((zaal)var3).k();
            return new zyy(1.0D + (double)(var2 ? var4.b() : var4.d()));
         }
      } else {
         return new zyy((double)((var2 ? var1.g : var1.h) + 1));
      }
   }

   public static zagu a(zagu[] var0, zaay var1) {
      String[] var2 = new String[1];
      zyz var3 = zaaq.a(var0, var1, 0, (String[])var2);
      if (var3 != null) {
         return var3;
      } else {
         var2[0] = var2[0].toUpperCase();
         zagu var10;
         zaye var18;
         String var21;
         switch(a.a(var2[0])) {
         case 0:
            if (var0.length < 2) {
               return new zyy((double)var1.h + 1.0D);
            } else {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               } else {
                  var18 = ((zaal)var10).k();
                  if (var18.a() != null && (var18.a().a & '\uffff') != var1.p.i) {
                     return zzb.a;
                  }

                  return new zyy((double)var18.d() + 1.0D);
               }
            }
         case 1:
            if (var0.length < 2) {
               return new zyy((double)var1.g + 1.0D);
            } else {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               } else {
                  var18 = ((zaal)var10).k();
                  if (var18.a() != null && (var18.a().a & '\uffff') != var1.p.i) {
                     return zzb.a;
                  }

                  return new zyy((double)var18.b() + 1.0D);
               }
            }
         case 2:
            if (var0.length < 2) {
               return new zaam("$" + CellsHelper.columnIndexToName(var1.h) + "$" + (var1.g + 1));
            } else {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               } else {
                  var18 = ((zaal)var10).k();
                  zur var16 = var18.a();
                  if (var16 != null) {
                     if ((var16.a & '\uffff') != var1.p.i) {
                        return zzb.a;
                     }

                     if (var16.b != var16.c) {
                        return zzg.a;
                     }

                     if ((var16.b & '\uffff') == var1.n) {
                        var16 = null;
                     } else if ((var16.b & '\uffff') != var1.n && (var16.b & '\uffff') < var1.p.g.getCount()) {
                        var21 = var1.p.g.get(var16.b & '\uffff').getName();
                        StringBuilder var15 = new StringBuilder();
                        boolean var17 = zaan.a(var21, var1);
                        if (var17) {
                           var15.append('\'');
                        }

                        String var20 = var1.p.f.getFileName();
                        if (var20 != null || !"".equals(var20)) {
                           var20 = var20.replace('/', '\\');
                           var15.append('[');
                           var15.append(var20.substring(var20.lastIndexOf(92) + 1));
                           var15.append(']');
                        }

                        var15.append(var21);
                        if (var17) {
                           var15.append('\'');
                        }

                        var15.append("!$").append(CellsHelper.columnIndexToName(var18.d())).append('$').append(var18.b() + 1);
                        return new zaam(com.aspose.cells.b.a.zr.a(var15));
                     }
                  }

                  return new zaam((new zaal(32, new zaye(var16, var18.b(), var18.d(), var18.b(), var18.d()))).k(var1));
               }
            }
         case 3:
            String var13 = var1.d.getName();
            StringBuilder var14 = new StringBuilder();
            if (var0.length > 1) {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               }

               zur var19 = ((zaal)var10).k().a();
               if (var19 != null) {
                  if ((var19.a & '\uffff') != var1.p.i) {
                     return zzb.a;
                  }

                  if ((var19.b & '\uffff') < var1.p.g.getCount()) {
                     var13 = var1.p.g.get(var19.b & '\uffff').getName();
                  }
               }
            }

            var21 = var1.p.f.getFileName();
            if (var21 != null && !"".equals(var21)) {
               var21 = var21.replace('/', '\\');
               int var12 = var21.lastIndexOf(92);
               var14.append(var21.substring(0, 0 + var12 + 1));
               var14.append('[');
               var14.append(var21.substring(var12 + 1));
               var14.append(']');
               var14.append(var13);
               return new zaam(com.aspose.cells.b.a.zr.a(var14));
            }

            return zaam.a;
         case 4:
         case 5:
         case 6:
         case 7:
         case 8:
         case 9:
         case 10:
         case 11:
            Cells var4 = null;
            int var5 = var1.g;
            int var6 = var1.h;
            if (var0.length > 1) {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               }

               zaye var7 = ((zaal)var10).k();
               var5 = var7.b();
               var6 = var7.d();
               if (var7.a() != null) {
                  zur var8 = var7.a();
                  WorksheetCollection var9 = var1.p.g;
                  if ((var8.a & '\uffff') != var9.u()) {
                     return zzb.a;
                  }

                  if ((var8.b & '\uffff') >= var9.getCount()) {
                     return zzf.a;
                  }

                  var4 = var9.get(var8.b & '\uffff').getCells();
               }
            }

            if (var4 == null) {
               var4 = var1.d.getCells();
            }

            switch(a.a(var2[0])) {
            case 4:
               return new zyy((double)com.aspose.cells.b.a.zq.a(var4.getColumnWidth(var6)));
            case 5:
               return new zaam(zes.c(var4, var5, var6, var1));
            case 6:
               return new zaam(zes.a(var4, var5, var6, var1));
            case 7:
               return new zyy(zes.e(var4, var5, var6, var1));
            case 8:
               zagu var11 = zaaq.a(var4, var5, var6, true, var1);
               if (var11 == null) {
                  return zyy.a;
               }

               return var11;
            case 9:
               return new zaam(zes.f(var4, var5, var6, var1));
            case 10:
               return new zyy(zes.b(var4, var5, var6, var1));
            case 11:
               return new zyy(zes.d(var4, var5, var6, var1));
            }
         default:
            if (var0.length > 1) {
               var10 = zaaq.a(var0[1], var1);
               if (var10.b() != 9) {
                  return var10;
               }

               var18 = ((zaal)var10).k();
               if (var18.a() != null && (var18.a().a & '\uffff') != var1.p.i) {
                  return zzb.a;
               }
            }

            return zzg.a;
         }
      }
   }

   static zagu b(zagu[] var0, zaay var1) {
      zagu var2 = var0[0];
      if (!var2.f()) {
         zaaq.a(var2, var0[1]);
         if (var0.length > 2) {
            zaaq.a(var2, var0[2]);
         }
      }

      var2 = var2.e(var1);
      if (var2.b() == 0) {
         return var2;
      } else {
         boolean var3 = false;
         zyv var4 = var2.j(var1);
         if (var4 == null) {
            return zzg.a;
         } else {
            var3 = var4.k();
            if (var3) {
               return var0[1];
            } else {
               return (zagu)(var0.length > 2 ? var0[2] : zyw.a);
            }
         }
      }
   }

   private static zagu a(String var0, int var1) {
      if (var0.length() < 10) {
         if (var0.length() > var1) {
            return zze.a;
         }

         var0 = com.aspose.cells.b.a.zv.a(var0, var1, '0');
      } else if (var0.length() > 10) {
         var0 = var0.substring(var0.length() - 10, var0.length() - 10 + 10);
      }

      return new zaam(var0);
   }

   private static zagu a(String var0, int var1, int var2, double[] var3) {
      if (var3 == null) {
         String var4 = zev.a(var0, var1, var2);
         if (var4.length() > 10) {
            var4 = var4.substring(var4.length() - 10, var4.length() - 10 + 10);
         }

         return new zaam(var4);
      } else {
         return (zagu)(var3[0] >= 1.0D && var3[0] < 11.0D ? a(zev.a(var0, var1, var2), (int)var3[0]) : zze.a);
      }
   }

   private static String a(double var0, int var2, zaay var3) {
      boolean var4 = false;
      if (var0 < 0.0D) {
         var4 = true;
         var0 = Math.abs(var0);
      }

      String var5;
      if (var2 > 0) {
         var5 = "$#,##0." + com.aspose.cells.b.a.zv.a('0', var2);
      } else {
         if (var2 < 0) {
            var0 = (double)((int)(var0 / Math.pow(10.0D, (double)(-var2)) + 0.5D)) * Math.pow(10.0D, (double)(-var2));
         }

         var5 = "$#,##0";
      }

      var5 = var3.p.a(var5, 14, var0).h();
      return var4 && var0 > 0.0D ? "(" + var5 + ")" : var5;
   }

   private static String a(double var0, int var2, boolean var3, zaay var4) {
      String var5;
      if (var3) {
         var5 = "0";
      } else {
         var5 = "#,##0";
      }

      if (var2 > 0) {
         var5 = var5 + "." + com.aspose.cells.b.a.zv.a('0', var2);
      } else if (var2 < 0) {
         double var6 = Math.pow(10.0D, (double)var2);
         if (var0 > 0.0D) {
            var0 = (double)((int)(var0 * var6 + 0.5D)) / var6;
         } else {
            var0 = (double)((int)(var0 * var6 - 0.5D)) / var6;
         }
      }

      return var4.p.a(var5, 14, var0).h();
   }

   private static int a(double var0) {
      if (var0 >= 1.0D) {
         return (int)var0;
      } else if (var0 > 0.0D) {
         return -2;
      } else if (var0 > -1.0D) {
         return 2;
      } else {
         return var0 > -2.0D ? 1 : (int)var0;
      }
   }
}
